View Javadoc
1 /* 2 * Created on 2004.09.23. 3 * 4 * In p2p project 5 */ 6 7 8 package net.sf.bigyo.container.config; 9 10 import net.sf.bigyo.api.Reconfigurable; 11 import net.sf.bigyo.container.ReconfigurationFailedException; 12 import net.sf.bigyo.model.ComponentConfig; 13 14 /*** 15 * @author zsombor 16 * 17 * Created at 1:37:42 net.sf.bigyo.container.config.SimpleConfigurationStrategy 18 * 19 */ 20 public class SimpleConfigurationStrategy implements ConfigurationStrategy { 21 22 /*** 23 * 24 */ 25 public SimpleConfigurationStrategy() { 26 super(); 27 // Auto-generated constructor stub 28 } 29 30 /* 31 * (non-Javadoc) 32 * 33 * @see net.sf.bigyo.container.config.ConfigurationStrategy#initConfigurationBean(java.lang.Object) 34 */ 35 public Object initConfigurationBean(Object bean) { 36 return bean; 37 } 38 39 /* 40 * (non-Javadoc) 41 * 42 * @see net.sf.bigyo.container.config.ConfigurationStrategy#reconfigureService(java.lang.Object, 43 * net.sf.bigyo.container.ComponentConfig, 44 * net.sf.bigyo.container.ComponentConfig) 45 */ 46 public void reconfigureService(Object service, ComponentConfig oldConfig, ComponentConfig newConfig) 47 throws ReconfigurationFailedException, ReconfigurationNotSupportedException { 48 try { 49 ((Reconfigurable) service).reconfigure(newConfig.getConfigBean(), null); 50 } catch (ClassCastException cce) { 51 throw new ReconfigurationNotSupportedException("Not reconfigurable " + service.getClass().getName() 52 + " service!", cce); 53 } 54 } 55 56 /* 57 * (non-Javadoc) 58 * 59 * @see net.sf.bigyo.container.config.ConfigurationStrategy#getSerializableConfigurationBean(java.lang.Object) 60 */ 61 public Object getSerializableConfigurationBean(Object bean) { 62 return bean; 63 } 64 65 public boolean isModifiedSince(ComponentConfig configBean) { 66 return false; 67 } 68 69 }

This page was automatically generated by Maven